import http from './config'
import da from "element-ui/src/locale/lang/da";

// 登录
export const _login = (data = {}) => {
    return http.post('/cms/unAuth/login/login', data)
}

// 获取文件上传地址
export const _getUploadUrl = (fileName) => {
    return http.post('/cms/auth/fileAuth/getUploadUrl', fileName)
}

// 获取文件预览地址
export const _downloadUrl = (fileName) => {
    return http.post('/cms/auth/fileAuth/getDownloadUrl', fileName)
}

// 根据userId查询用户信息
export const _getUserInfo = (userId) => {
    return http.post('/cms/auth/user/queryByUserId', userId)
}

// 获取用户列表
export const _getUserList = (data = {}) => {
    return http.post('/cms/auth/user/listUserInfo', data)
}

// 修改当前用户账号密码
export const _changePwd = (data = {}) => {
    return http.post('/cms/auth/user/modifyPwd', data)
}

// 重置用户密码
export const _rechangePwd = (userId) => {
    return http.post('/cms/auth/user/resetPwd', userId)
}

// 修改用户信息
export const _editUserInfo = (data = {}) => {
    return http.post('/cms/auth/user/userInfo/update', data)
}

// 查询用户菜单权限
export const _getMenus = (userId) => {
    return http.post('/cms/auth/menu/menuByUserId', userId)
}

// 修改角色
export const _editRole = (data = {}) => {
    return http.post('/cms/auth/role/update', data)
}

// 新增角色
export const _saveRole = (data = {}) => {
    return http.post('/cms/auth/role/save', data)
}
/*---------------字典相关----------------------*/
// 刷新缓存字典
export const _cacheDict = () => {
    return http.post('/cms/auth/dict/cache')
}

// 修改字典
export const _editDict = (data = {}) => {
    return http.post('/cms/auth/dict/updateDict', data)
}

// 新增字典
export const _saveDict = (data = {}) => {
    return http.post('/cms/auth/dict/saveDict', data)
}

// 删除数据字典
export const _deleteDict = (dictId) => {
    return http.post('/cms/auth/dict/removeDict', dictId)
}

// 查询数据字典
export const _getDict = (data = {}) => {
    return http.post('/cms/auth/dict/selectDict', data)
}

//用户项目
export const _getItemList = (data = {}) => {
    return http.post('/cms/auth/user/item/listUserItem', data)
}

//回复反馈
export const _replyContent = (data = {}) => {
    return http.post('/cms/auth/user/feedback/replyFeedback', data)
}

//新增广告
export const _addAd = (data = {}) => {
    return http.post('/cms/auth/advertise/addAdvertise', data)
}

//修改广告
export const _editAd = (data = {}) => {
    return http.post('/cms/auth/advertise/modifyAdvertise', data)
}
